<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>首页</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
  <link rel="stylesheet" href="../static/css/me.css">
  <link rel="icon" href="../static/favicon.ico">
</head>
<body>

  <!--导航-->
  <div th:replace="common/header :: menu(1)"></div>

  <!--中间内容-->
  <div  class="m-container m-padded-tb-big">
    <div class="ui container">
      <div class="ui stackable grid">
        <!--左边博客列表-->
        <div class="eleven wide column">
          <!--header-->
          <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
              <div class="column">
                <h3 class="ui teal header">博客</h3>
              </div>
              <div class="right aligned column">
                共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${blogs.size()}"> </h2> 篇
              </div>
            </div>
          </div>

          <!--content-->
          <div class="ui attached  segment">

            <div class="ui padded vertical segment m-padded-tb-large" th:each="blog:${pages.list}">
              <div class="ui mobile reversed stackable grid">
                <div class="eleven wide column">
                  <h3 class="ui header"><a th:href="@{/blog(id=${blog.id})}" target="_blank">[[${blog.title}]]</a></h3>
                  <p class="m-text line-limit-length">[[${blog.content}]]</p>
                  <div class="ui grid">
                    <div class="eleven wide column">
                      <div class="ui mini horizontal link list">
                        <div class="item">
                          <img src="/static/images/profilePhoto.jpg" alt="" class="ui avatar image">
                          <div class="content"><a href="/about" class="header">薄哥鸭</a></div>
                        </div>
                        <div class="item">
                          <i class="calendar icon"></i> [[${#dates.format(blog.creatTime,'yyy-MM-dd')}]]
                        </div>
                        <div class="item">
                          <i class="eye icon"></i> [[${blog.view}]]
                        </div>
                      </div>
                    </div>
                    <div class="right aligned five wide column">
                      <a th:href="@{/blog(id=${blog.id})}" target="_blank" class="ui teal basic label m-padded-tiny m-text-thin">认知升级</a>
                    </div>
                  </div>
                </div>

                <div class="five wide column">
                  <a th:href="@{/blog(id=${blog.id})}" target="_blank">
                    <img src="/static/images/profilePhoto.jpg" alt="" class="ui rounded image">
                  </a>
                </div>

              </div>
            </div>

          </div>

          <!--footer-->
          <div class="ui bottom attached segment">
            <div class="ui middle aligned two column grid">
              <div class="column">
                <a th:href="@{/index(page=${pages.hasPreviousPage}?${pages.prePage}:1)}" class="ui mini teal basic button">上一页</a>
              </div>
              <div class="right aligned column">
                <a th:href="@{/index(page=${pages.hasNextPage}?${pages.nextPage}:${pages.pages})}" class="ui mini teal basic button">下一页</a>
              </div>
            </div>
          </div>

        </div>

        <!--右边的top-->
        <div class="five wide column">

          <!--分类-->
          <div class="ui segments">
            <div class="ui secondary segment">
              <div class="ui two column grid">
                <div class="column">
                  <i class="idea icon"></i>分类
                </div>
                <div class="right aligned column">
                  <a href="/types" target="_blank">more <i class="angle double right icon"></i></a>
                </div>
              </div>
            </div>
            <div class="ui teal segment">
              <div class="ui fluid vertical menu">
                <a th:href="@{/types(type=${type.name})}" th:each="type:${types}" class="item" >
                  [[${type.name}]]
                  <div class="ui teal basic left pointing label">[[${type.typeCount}]]</div>
                </a>
              </div>
            </div>
          </div>

          <!--标签-->
          <div class="ui segments m-margin-top-large">
            <div class="ui secondary segment">
              <div class="ui two column grid">
                <div class="column">
                  <i class="tags icon"></i>标签
                </div>
                <div class="right aligned column">
                  <a href="/tags" target="_blank">more <i class="angle double right icon"></i></a>
                </div>
              </div>
            </div>
            <div class="ui teal segment">
              <a th:href="@{/tags(id=${tag.id})}" th:each="tag:${tags}" class="ui teal basic left pointing label m-margin-tb-tiny">
                [[${tag.name}]]
                <div class="detail">[[${tag.tagCount}]]</div>
              </a>
            </div>
          </div>

          <!--最新推荐-->
          <div class="ui segments m-margin-top-large">
            <div class="ui secondary segment ">
              <i class="bookmark icon"></i>最新推荐
            </div>
            <div class="ui segment" th:each="blog:${blogs}">
              <a th:href="@{/blog(id=${blog.id})}" target="_blank" class="m-black m-text-thin">[[${blog.title}]]</a>
            </div>
          </div>

          <!--二维码-->
          <h4 class="ui horizontal divider header m-margin-top-large">扫码关注我</h4>
          <div class="ui centered card" style="width: 11em">
            <img src="/static/images/wechat.jpg" alt="" class="ui rounded image" >
          </div>
        </div>

      </div>
    </div>

  </div>

  <br>
  <br>

  <!--底部footer-->
  <div th:replace="common/footer :: #footer"></div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });
  </script>



</body>
</html>